package com.wander.designCreational.simplefactory.factory;

import com.wander.designCreational.simplefactory.product.ApplePhoneImpl;
import com.wander.designCreational.simplefactory.product.Phone;
import com.wander.designCreational.simplefactory.product.RedmiPhoneImpl;

/**
 * @Author : WDYin
 * @Date : 2020/5/8
 * @Description :
 */
public class Factory {

    public static Phone getPhone(String type) {
        Phone phone = null;
        if ("红米".equals(type)) {
            phone = new RedmiPhoneImpl();
        } else if ("苹果".equals(type)) {
            phone = new ApplePhoneImpl();
        }//.....
        return phone;
    }
}
